App({
  editTabBar: function () {
    var tabbar = this.globalData.tabbar,
      currentPages = getCurrentPages(),
      _this = currentPages[currentPages.length - 1],
      pagePath = _this.__route__;
    (pagePath.indexOf('/') != 0) && (pagePath = '/' + pagePath);
    for (var i in tabbar.list) {
      tabbar.list[i].selected = false;
      (tabbar.list[i].pagePath == pagePath) && (tabbar.list[i].selected = true);
    }
    _this.setData({
      tabbar: tabbar
    });
  },
  globalData: {
    tabbar: {
      color: "rgb(100,100,100)",
      selectedColor: "rgb(100,100,100)",
      list: [
        {
          pagePath: "/pages/home/home",
          text: "首页",
          iconPath: "/img/home1.png",
          selectedIconPath: "/img/home2.png",
          open_type: "redirect",
          hover_class:"none",
          width:"42%",
          selected: true
        },
        {
          pagePath: "/pages/home/home",
          open_type: "navigate",
          hover_class: "none",
          width: "16%",
          text: "我要参加",
          selected: false
        },
        {
          pagePath: "/pages/my/my",
          text: "我的",
          iconPath: "/img/my1.png",
          selectedIconPath: "/img/my2.png",
          open_type: "redirect",
          hover_class: "none",
          width: "42%",
          selected: false
        }
      ],
    }
  }
})